﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EntityModel;
using Common;
namespace Services
{
    public class MethodService
    {
        #region***属性数据***

        ShopDbEntities bdContext = DbContextHelper.GetCurrentDbContext();


        #endregion

        #region 获取所有分类

        /// <summary>
        /// 获取所有分类
        /// </summary>
        /// <returns></returns>
        ///  PagedList<Category>
        ///  
        public IQueryable<Method> GetAllList()
        {
            return bdContext.Methods.OrderByDescending(c => c.Id);
        }

        #endregion


        #region 新增数据

        public void Create(Method model)
        {
            bdContext.Methods.AddObject(model);
            bdContext.SaveChanges();
        }
        #endregion
    }
}
